import request from '@/utils/request'

export function addStaff (data) { //添加员工
  return request({
    url: '/upms/emp',
    method: 'post',
    data
  })
}

export function staffRoleList (empId) { //员工角色列表
  return request({
    url: '/upms/emp/role',
    method: 'get',
    params : {empId}
  })
}
export function staffList (empNo,empMobile,empName,isLock) {//员工列表
  let data = {
    empNo : empNo,
    empMobile : empMobile,
    empName : empName,
    isLock :isLock
  }
  JSON.stringify(data)
  return request({
    url: '/upms/emp/search',
    method: 'get',
    params : data
  })
}

export function staffRoleallot (data) {//员工关联角色
  return request({
    url: '/upms/emp/role',
    method: 'post',
    data
  })
}

export function switchStaff (data) {//解锁加锁员工
   return request({
     url: '/upms/emp/lock',
     method: 'put',
     params : data
   })
}

export function delStaff (empId) {//删除员工
  return request({
    url: '/upms/emp',
    method: 'DELETE',
    params : {empId}
  })
}
